<admintpl file="header" />
<body class="J_scroll_fixed">
	<div class="wrap J_check_wrap">
	 	
		<ul class="nav nav-tabs">
	        <li class="active"><a href="#A" data-toggle="tab">网站信息</a></li>
	        <li><a href="#B" data-toggle="tab">SEO设置</a></li>
	        <li><a href="#C" data-toggle="tab">URL设置</a></li>
	        <li><a href="{:U('route/index')}" >URL美化</a></li>
	        <li><a href="#D" data-toggle="tab">用户同步</a></li>
	        <li><a href="#E" data-toggle="tab">评论设置</a></li>
	        <li><a href="#F" data-toggle="tab">用户名过滤</a></li>
	    </ul>
		
		<form class="J_ajaxForms" name="myform" id="myform" action="{:u('setting/site_post')}" method="post">
		 <fieldset>
		<div class="tabbable">
        <div class="tab-content">
          <div class="tab-pane active" id="A">
            <table cellpadding="2" cellspacing="2" class="table_form" width="100%">
				<tbody>
					<tr>
						<td width="180">网站名称：</td>
						<td><input type="text" class="input" name="options[site_name]" value="{$site_name}"><span class="must_red">*</span>
						<php>if($option_id):</php>
						<input type="hidden" class="input" name="option_id" value="{$option_id}">
						<php>endif;</php>
						</td>
					</tr>
					<tr>
						<td>网站域名：</td>
						<td><input type="text" class="input" name="options[site_host]" value="{$site_host}"><span class="must_red">*</span></td>
					</tr>
					<tr>
						<td>安装路径：</td>
						<td><input type="text" class="input" name="options[site_root]" value="{$site_root}"><span class="must_red">*&nbsp;&nbsp;如安装在根目录请填“/”</span></td>
					</tr>
					<tr>
						<td>模版方案：</td>
						<td>
							<select name="options[site_tpl]" class="normal_select" >
								<foreach name="templates" item="vo">
									<php>$tpl_selected=$site_tpl==$vo?"selected":"";</php>
									<option value="{$vo}" {$tpl_selected}>{$vo}</option>
								</foreach>
							</select>
						</td>
					</tr>
					<tr>
						<td>开启手机模板：</td>
						<td>
							<php>$mobile_tpl_enabled_checked=empty($mobile_tpl_enabled)?'':'checked';</php>
							<label class="checkbox inline">
								<input type="checkbox" name="options[mobile_tpl_enabled]" {$mobile_tpl_enabled_checked} value="1"/>
							</label>
						</td>
					</tr>
					<tr>
						<td>后台风格：</td>
						<td>
							<select name="options[site_adminstyle]" class="normal_select" >
								<foreach name="adminstyles" item="vo">
									<php>$adminstyle_selected=$site_adminstyle==$vo?"selected":"";</php>
									<option value="{$vo}" {$adminstyle_selected}>{$vo}</option>
								</foreach>
							</select>
						</td>
					</tr>
					<tr>
						<td>备案信息：</td>
						<td><input type="text" class="input" name="options[site_icp]" value="{$site_icp}"></td>
					</tr>
					<tr>
						<td>站长邮箱：</td>
						<td><input type="text" class="input" name="options[site_admin_email]" value="{$site_admin_email}"></td>
					</tr>
					
					<tr>
						<td>统计代码：</td>
						<td><textarea name="options[site_tongji]" rows="5" cols="57">{$site_tongji}</textarea></td>
					</tr>
					<tr>
						<td>版权信息：</td>
						<td><textarea name=options[site_copyright] rows="5" cols="57">{$site_copyright}</textarea></td>
					</tr>
				</tbody>
			</table>
          </div>
          <div class="tab-pane" id="B">
            <table cellpadding="2" cellspacing="2" class="table_form"
							width="100%">
							<tbody>
								<tr>
									<td width="180">SEO标题:</td>
									<td><input type="text" class="input" name="options[site_seo_title]" value="{$site_seo_title}"></td>
								</tr>
								<tr>
									<td>SEO关键字:</td>
									<td><input type="text" class="input" name="options[site_seo_keywords]" value="{$site_seo_keywords}"></td>
								</tr>
								<tr>
									<td>SEO描述:</td>
									<td><textarea name="options[site_seo_description]" rows="5" cols="57">{$site_seo_description}</textarea></td>
								</tr>
							</tbody>
						</table>
          </div>
          <div class="tab-pane" id="C">
            <table cellpadding="2" cellspacing="2" class="table_form" width="100%">
							<tbody>
								<tr>
									<td width="180">url模式：</td>
									<td>
										<php>$urlmodes=array(
											"0"=>"普通模式",
											"1"=>"PATHINFO模式",
											"2"=>"REWRITE模式"
										);</php>
										<select name="options[urlmode]"  class="normal_select">
											<foreach name="urlmodes" item="vo">
												<php>$urlmode_selected=$key==$urlmode?"selected":"";</php>
												<option value="{$key}" {$urlmode_selected}>{$vo}</option>
											</foreach>
										</select>
										<span class="must_red">*&nbsp;&nbsp;如果你开启的是REWRITE模式，请确保服务器支持REWRITE；</span>
									</td>
								</tr>
								<tr>
									<td>URL伪静态后缀：</td>
									<td><input type="text" class="input" name="options[html_suffix]" value="{$html_suffix}"><span class="must_red">&nbsp;&nbsp;普通模式不支持</span></td>
								</tr>
							</tbody>
						</table>
          </div>
          <div class="tab-pane" id="D">
            <table cellpadding="0" cellspacing="0" class="table_form" width="100%">
							<tbody>
								<tr>
									<td width="200">开启Ucenter:</td>
									<td>
										<php>$ucenter_enabled_checked=empty($ucenter_enabled)?"":"checked";</php>
										<input type="checkbox" class="J_check" name="options[ucenter_enabled]" value="1" {$ucenter_enabled_checked}>
									</td>
								</tr>
							</tbody>
						</table>
          </div>
          <div class="tab-pane" id="E">
            <table cellpadding="0" cellspacing="0" class="table_form" width="100%">
							<tbody>
								<tr>
									<td width="200">评论审核:</td>
									<td>
										<php>$comment_need_checked=empty($comment_need_check)?"":"checked";</php>
										<input type="checkbox" class="J_check" name="options[comment_need_check]" value="1" {$comment_need_checked}>
									</td>
								</tr>
							</tbody>
						</table>
          </div>
          <div class="tab-pane" id="F">
            <table cellpadding="0" cellspacing="0" class="table_form" width="100%">
							<tbody>
								<tr>
									<td width="200">特殊用户名:</td>
									<td>
										<textarea name="cmf_settings[banned_usernames]" rows="5" cols="57">{$cmf_settings.banned_usernames}</textarea>
									</td>
								</tr>
							</tbody>
						</table>
          </div>
        </div>
      </div>
      
      	<div class="form-actions">
            <button type="submit" class="btn btn-primary btn_submit  J_ajax_submit_btn">提交</button>
          </div>
           </fieldset>
		</form>
		
	</div>
	<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
	<script>
/////---------------------
	 Wind.use('validate', 'ajaxForm', 'artDialog', function () {
			//javascript
	        var form = $('form.J_ajaxForms');
	        //ie处理placeholder提交问题
	        if ($.browser.msie) {
	            form.find('[placeholder]').each(function () {
	                var input = $(this);
	                if (input.val() == input.attr('placeholder')) {
	                    input.val('');
	                }
	            });
	        }
	        //表单验证开始
	        form.validate({
				//是否在获取焦点时验证
				onfocusout:false,
				//是否在敲击键盘时验证
				onkeyup:false,
				//当鼠标掉级时验证
				onclick: false,
	            //验证错误
	            showErrors: function (errorMap, errorArr) {
					//errorMap {'name':'错误信息'}
					//errorArr [{'message':'错误信息',element:({})}]
					try{
						$(errorArr[0].element).focus();
						art.dialog({
							id:'error',
							icon: 'error',
							lock: true,
							fixed: true,
							background:"#CCCCCC",
							opacity:0,
							content: errorArr[0].message,
							cancelVal: '确定',
							cancel: function(){
								$(errorArr[0].element).focus();
							}
						});
					}catch(err){
					}
	            },
	            //验证规则
	            rules: {'options[site_name]':{required:1},'options[site_host]':{required:1},'options[site_root]':{required:1}},
	            //验证未通过提示消息
	            messages: {'options[site_name]':{required:'请输入网站名称！'},'options[site_host]':{required:'请输入网站域名！'},'options[site_root]':{required:'请输入安装路径！'}},
	            //给未通过验证的元素加效果,闪烁等
	            highlight: false,
	            //是否在获取焦点时验证
	            onfocusout: false,
	            //验证通过，提交表单
	            submitHandler: function (forms) {
	                $(forms).ajaxSubmit({
	                    url: form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
	                    dataType: 'json',
	                    beforeSubmit: function (arr, $form, options) {
	                        
	                    },
	                    success: function (data, statusText, xhr, $form) {
	                        if(data.status){
								setCookie("refersh_time",1);
								//添加成功
								Wind.use("artDialog", function () {
								    art.dialog({
								        id: "succeed",
								        icon: "succeed",
								        fixed: true,
								        lock: true,
								        background: "#CCCCCC",
								        opacity: 0,
								        content: data.info,
										button:[
											{
												name: '确定',
												callback:function(){
													return true;
												},
												focus: true
											},{
												name: '关闭',
												callback:function(){
													return true;
												}
											}
										]
								    });
								});
							}else{
								alert(data.info);
							}
	                    }
	                });
	            }
	        });
	    });
	////-------------------------
	
	
	</script>
</body>
</html>